let pomelo = require('pomelo');
let exp = module.exports = {};

// ------------------------------联盟基础数据-------------------------------
//获取所有的上级
exp.getSpreaderUser = (unionID, userID) => {
    return new Promise((resolve, reject) => {
        pomelo.app.rpc.center.unionRemote.getSpreaderUser.toServer('center', unionID, userID, function (err, data) {
            if (!!err) {
                reject(err);
            } else {
                resolve(data);
            }
        });
    });
};

//获取所有的下级
exp.getLowerUser = (unionID, userID) => {
    return new Promise((resolve, reject) => {
        pomelo.app.rpc.center.unionRemote.getLowerUser.toServer('center', unionID, userID, function (err, data) {
            if (!!err) {
                reject(err);
            } else {
                resolve(data);
            }
        });
    });
};